package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select c.* from tb_category_brand cb, tb_category c where cb.category_id = c.id and cb.brand_id = #{id}")
    List<Category> findCategoryByBrandId(@Param("id") Long id);
}
